﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User/User.Master" AutoEventWireup="true" CodeBehind="Print_WLTM.aspx.cs" Inherits="CoolERP_Web.User.Print_WLTM" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
    function MyPreview() {
        var flag = false;
        $("#tbList input[type=checkbox][id=chkSel]").each(function () {
            if ($(this).attr("checked") == true) {
                flag = true;
                return;
            }
        });
        if (flag){
            LODOP.PRINT_INIT("打印控件Lodop功能演示_多页预览");
            LODOP.SET_PRINT_PAGESIZE(1, 1000, 700, "");
            CreateAllPages();
            LODOP.PREVIEW();
        }
        else
            alert("请选择你要打印的数据");
    }
    function CreateAllPages() {
        $("#tbList input[type=checkbox][id=chkSel]").each(function () {
            if ($(this).attr("checked") == true) {
                var tr = $(this).closest("tr");
                LODOP.NewPage();
                //LODOP.SET_PRINT_PAGESIZE(2, 1000, 700, "");
                var code = $(tr).find("td").eq(1).text() + "/" + $(tr).find("td").eq(9).text();
                LODOP.ADD_PRINT_BARCODE(10, 10, 200, 50, "128A", code);
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 6);
                LODOP.ADD_PRINT_TEXT(80, 20, 400, 20, "物料名称：" + $(tr).find("td").eq(2).text());
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
                LODOP.ADD_PRINT_TEXT(110, 20, 400, 20, "规    格：" + $(tr).find("td").eq(3).text());
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
                LODOP.ADD_PRINT_TEXT(140, 20, 400, 20, "颜    色：" + $(tr).find("td").eq(4).text());
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
                LODOP.ADD_PRINT_TEXT(170, 20, 400, 20, "单    位：" + $(tr).find("td").eq(5).text());
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
                LODOP.ADD_PRINT_TEXT(200, 20, 400, 20, "物料类型：" + $(tr).find("td").eq(6).text());
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
                LODOP.ADD_PRINT_TEXT(230, 20, 400, 20, "供 应 商：" + $(tr).find("td").eq(7).text());
                LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
            }
        });
    }	
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td class=tbHead_L></td>
        <td class=tbHead_M><div><B>物料条码打印</B></div></td>
        <td class=tbHead_R></td>
    </tr>
    <tr>
        <td class=tbBody_L></td>
        <td class=tbBody_M>
            <ul class=tags style="width:100%;">
                <li class=liTitle><div>物料查询</div></li>
            </ul>
            <table class="grvCSS" cellspacing="0" cellpadding=2 border="1" style="width:100%;border-collapse:collapse;">
                <tr>
                    <td>物料编号：<asp:TextBox ID="tbBH" runat="server" CssClass="textbox" MaxLength="64"></asp:TextBox></td>
                    <td>物料名称：<asp:TextBox ID="tbMC" runat="server" CssClass="textbox" MaxLength="64"></asp:TextBox></td>
                    <td>物料类型：<asp:DropDownList ID="ddlWLLX" runat="server" CssClass="dropdown"></asp:DropDownList></td>
                    <td>供应商：<asp:DropDownList ID="ddlGYSID" runat="server" CssClass="dropdown"></asp:DropDownList></td>
                    <td><asp:ImageButton ID="btnQuery" runat="server" ImageUrl="~/Images/Common/btn_query0.png" onclick="btnQuery_Click" /></td>
                </tr>
            </table>
            <ul class=tags style="width:100%;">
                <li class=liTitle><div>物料列表</div></li>
                <li class=liRight><input type="button" value="打印预览" onclick="MyPreview()" class=btn_s /></li>
            </ul>
            <asp:Repeater ID="Repeater1" runat="server">
            <HeaderTemplate>
            <table id="tbList" class="grvCSS" cellspacing="0" cellpadding=0 border="1" style="width:100%;border-collapse:collapse;">
                <tr>
                    <th><label><input type="checkbox" onclick="checkAll('tbList',this)" />全选</label></th>
                    <th>物料编号</th><th>物料名称</th><th>物料规格</th><th>颜色</th><th>单位</th><th>物料类型</th><th>供应商</th>
                    <th>仓库</th><th>仓位（区-行-列-层-格）</th>
                </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td><input type=checkbox id="chkSel" name="chkSel" value='<%# Eval("WPID") %>' /></td>
                    <td><%# Eval("BH") %></td><td><%# Eval("MC") %></td><td><%# Eval("GG") %></td>
                    <td><%# Eval("YS") %></td><td><%# Eval("DWMC") %></td><td><%# Eval("LXMC")%></td><td><%# Eval("GYSMC") %></td>
                    <td><%# Eval("CKMC") %></td><td><%# Eval("QU")%>-<%# Eval("HANG")%>-<%# Eval("LIE")%>-<%# Eval("CENG")%>-<%# Eval("GE")%></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate></table></FooterTemplate>            
            </asp:Repeater>
        </td>
        <td class=tbBody_R></td>
    </tr>
    <tr>
        <td class=tbFoot_L></td>
        <td class=tbFoot_M></td>
        <td class=tbFoot_R></td>
    </tr>
</table>
</asp:Content>